home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / pbaseiv.zip / P4SPR008.TIP < prev    next >
Text File  |  1991-12-16  |  2KB  |  51 lines

  1. Sometimes I need a worksheet column to list the
  2. weekdays--and only weekdays--in a given month. Instead of
  3. looking at a calendar and manually entering numbers, I came
  4. up with a trick that automatically lets my monthly forecasts
  5. skip weekends.
  6.  
  7. [A .WK1 file with the formulae already in place can be found
  8. in the file P4SPREAD\WKDAY.WK1 on your PowerBase *.* Volume
  9. IV diskette. The following instructions can be used to
  10. reproduce the worksheet manually.]
  11.  
  12. To use the technique, enter a year value such as 91 in cell
  13. C1. Enter a month number in the range 1 to 12 in C2. You can
  14. use other cells, but you'll have to alter the cell numbers
  15. in the method's formulae.
  16.  
  17. Next, go to cell C4 and enter this formula:
  18.  
  19. @IF(@MOD(@DATE($C$1,$C$2,1),7)>1,1,@IF(@MOD(@DATE($C$1,$C$2,1),7)=1,2,3))
  20.  
  21. Drop down one row to C5, and enter
  22.  
  23. @IF(@MOD(@DATE($C$1,$C$2,C4+1),7)>1,1+C4,@IF(@MOD(@DATE($C$1,$C$2,C4+1),7)=1,2+C4,3+C4))
  24.  
  25. Finally, replicate cell C5 to cells C6 through C26. This
  26. will display the weekday numbers for the month, which you
  27. can use in expressions or simply as row labels.
  28.  
  29. To skip holidays that occur during the week, simply enter
  30. the next day number manually. For example, if July 4 falls
  31. on a weekday, move to the cell with the `4' and enter 5 to
  32. replace the formula. Subsequent cells will adjust
  33. automatically to account for the change.
  34.  
  35. Leo Lefkowits
  36. Houston, Texas
  37.  
  38. Editor's note: Copying the second formula to every cell down
  39. to C26 lists 23 days, the maximum number of weekdays you can
  40. have in a month. When there are fewer than 23 workdays in a
  41. month, or when you skip a holiday, you may get some ERRs or
  42. an occasional invalid day of the month (such as 32) at the
  43. bottom of the list. These are harmless and can be deleted if
  44. they annoy you.
  45.  
  46. Title: Worksheets for Weekend Warriors
  47. Category: SPR
  48. Issue date: Feb 1991
  49. Editor: Tom Swan
  50. Supplementary files: P4SPREAD\WKDAY.WK1
  51.